# Makefile 
# Andrew Turpin
# March 2013

EXE1 = assembler
OBJ1 = main.o graph.o hashtable.o listops.o vector.o

EXE2 = makeInput
OBJ2 = makeInput.o

CC     = g++ 
CFLAGS = -Wall #-g -DDEBUG   # uncomment these two for more output
CPPFLAGS = $(CFLAGS)

all: $(EXE1) $(EXE2)

$(EXE1):   $(OBJ1) Makefile
	$(CC) $(CFLAGS) -o $(EXE1) $(OBJ1)

$(EXE2):   $(OBJ2) Makefile
	$(CC) $(CFLAGS) -o $(EXE2) $(OBJ2)

clean:
	rm -f $(OBJ1) $(EXE1) $(EXE2) $(OBJ2)

main.o: main.h graph.h hashtable.h Makefile vertex.h listops.h vector.h
graph.o: graph.h Makefile vertex.h listops.h vector.h
makeInput.o: Makefile
hashtable.o: hashtable.h Makefile
vector.o: vector.h Makefile

test: all
	cat Makefile | ./makeInput 5 | ./assembler | tr 'N' '\012'
	cat Makefile | ./makeInput 3 | ./assembler | tr 'N' '\012'
